package com.bc.commonentity.log;

import com.bc.commoncore.util.CookieUtils;
import org.springframework.web.servlet.handler.HandlerInterceptorAdapter;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

public class GlobalLogInteceptor extends HandlerInterceptorAdapter {
    public boolean preHandle(HttpServletRequest request,
                             HttpServletResponse response, Object handler) throws Exception {
        return AspectLogHelper.springBefore(request, handler);
    }

    public void afterCompletion(HttpServletRequest request,
                                HttpServletResponse response, Object handler, Exception ex)
            throws Exception {
        AspectLogHelper.springAfterCompletion(request, handler, ex);
//        CookieUtils.setCookie(request, response, "local", "en", 3600);
//        String language = CookieUtils.getCookie(request, response, "local");


//        System.out.println(language);
    }

}
